/*
 * SensorMessageUtils.cpp
 *
 *  Created on: Feb 11, 2009
 *      Author: Andrzej Olchawa
 *      mailto: andrzejolchawa@gmail.com
 *      http://www.hardtechnology.org
 *      This is a part of the Armazd project, which is covered by
 *      GNU GPL v2 license.
 */

#include "SensorMessageUtils.h"

SensorMessageUtils::SensorMessageUtils() {}

SensorMessageUtils::~SensorMessageUtils() {}

int SensorMessageUtils::computeSyslogCode(int facility, int priority)
{
	return ((facility << 3) | priority);
}

int SensorMessageUtils::extractSyslogFacility(int code)
{
	return ((code & LOG_FACMASK) >> 3);
}

int SensorMessageUtils::extractSyslogPriority(int code)
{
	return (code & LOG_PRIMASK);
}
